package com.longway.core.toolbox.wdp.api;

import java.util.Map;

import com.jfinal.kit.JsonKit;
import com.jfinal.kit.Ret;
import com.longway.core.toolbox.utils.HttpUtils;

public class WxaPhoneApi {
    private static String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=";

    /**
     * access_token	string	是	接口调用凭证，该参数为 URL 参数，非 Body 参数。使用access_token或者authorizer_access_token
     * code	string	是	手机号获取凭证
     */
    public static Map<String,Object> getPhoneInfo(String code,String accessToken){
    	 final Map<String, String> queryParas = Ret.create("code", code);
    	  String json = HttpUtils.post(url+accessToken, JsonKit.toJson(queryParas));
    	  return JsonKit.parse(json, Map.class);
    }
}
